<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Tests a filename for validity as an RPM file</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.rpm-is-valid" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">rpm_is_valid</h1>
  <p class="verinfo">(PECL rpmreader &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">rpm_is_valid</span> &mdash; <span class="dc-title">Tests a filename for validity as an RPM file</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.rpm-is-valid-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>rpm_is_valid</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>
   ) : <span class="type">bool</span></div>

  <p class="para rdfs-comment">
    <span class="function"><strong>rpm_is_valid()</strong></span> will test an RPM file for
    validity as an RPM file.  This is not the same as
    <span class="function"><a href="rpm_open.html" class="function">rpm_open()</a></span> as it only checks the file for
    validity but does not return a file pointer to be used by further
    functions.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.rpm-is-valid-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">filename</code></dt>

     <dd>

      <p class="para">
        The filename of the RPM file you wish to check for validity.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.rpm-is-valid-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
    成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.rpm-is-valid-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4237">
    <p><strong>Example #1 <span class="function"><strong>rpm_is_valid()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$file&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"/path/to/file.rpm"</span><span style="color: #007700">;<br /><br />if&nbsp;(</span><span style="color: #0000BB">rpm_is_valid</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"File&nbsp;is&nbsp;recognized&nbsp;as&nbsp;an&nbsp;RPM&nbsp;file.&lt;br&gt;\n"</span><span style="color: #007700">;<br />}<br />else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"File&nbsp;is&nbsp;not&nbsp;recognized&nbsp;as&nbsp;an&nbsp;RPM&nbsp;file.&lt;br&gt;\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
 </div>

</div></div></div></body></html>